<table class="product-listing product-listing-table listing-highlight" id="<?php echo $this->box->getData('class') ?>">
<?php
$reviewSummaryBox = $this->box('community/ReviewRating')
    ->setProductIds(array_keys($this->box->getData('products')));
    
$i = 0;
$columnCount = $this->box->getColumnsCount(); 
foreach ($this->box->getData('products') as $prodId => $product) :
    $url = $this->hurl(array(
        'product' => array('value' => $prodId, 'seo' => $product['key_word']),
        'module' => 'Ecart_Catalog',
        'controller' => 'index',
        'action' => 'product'
    ), false, true);
?>
    <?php if ($i%$columnCount==0): ?>
       <tr>
    <?php endif; ?>
    
    <td>
        <div class="product-item">
            <h4 class="product-name"><a href="<?php echo $url;?>"
                title="<?php echo $this->escape($product['name']) ?>"
                ><?php echo $this->escape($product['name']) ?></a></h4>
            <?php
            $imagePath = isset($product['images'][$product['image_listing']]) ?
                $product['images'][$product['image_listing']]['path'] : '';
            $imageTitle = isset($product['images'][$product['image_listing']]) ?
                $product['images'][$product['image_listing']]['title'] : '';
            ?>
            <a href="<?php echo $url ?>"
                title="<?php echo $this->escape($imageTitle) ?>"
            ><?php 
            echo $this->imager('/product' . $imagePath, array(
                'width'  => $this->config()->image->product->widthSmall, 
                'height' => $this->config()->image->product->heightSmall, 
                'alt' => $this->escape($imageTitle), 
                'seo' => $product['image_seo_name']
            ));?></a>
            
            <?php echo $reviewSummaryBox->setProductId($product['id'])
                ->setProductUrl($product['key_word'])
                ->setSmallStars(true)
                ->toHtml() ?>
            
            <?php echo $this->price($product['price'], 
                !empty($product['price_discount']) ? 
                    $product['price_discount'] : false
            ) ?>
            
            <?php if ($product['is_saleable']): ?>
                <?php echo $this->button($this->translate('catalog')->__('Add to cart'), array(
                    'class' => 'button btn-add-to-cart',
                    'rel' => 'nofollow',
                    'href' => $this->href('checkout/cart/add/productId/' . $prodId, true)
                )) ?>
            <?php else: ?>
                <div class="out-of-stock"><?php echo $this->translate('catalog')->__('Out of stock') ?></div>
            <?php endif ?>
        </div>
    </td>
    
    <?php $i++; 
    
    if ($i%$columnCount==0) : ?>
       </tr>
    <?php endif;
    
endforeach;

if ($i % $columnCount != 0) :
    for($i; $i % $columnCount; $i++) : ?>
        <td class="empty-cell">&nbsp;</td>
    <?php 
    endfor;?>
    </tr>
<?php endif; ?>

</table>

<script type="text/javascript">
    decorateTable('<?php echo $this->box->getData('class') ?>');
</script>